package 剑指offer;

public class TestByte {

        public static void main(String args[])
        {
            Byte by1 = new Byte("123");
            Byte by2 = new Byte("123");
            int length = by1.SIZE;

            int max = by2.MAX_VALUE;
            int min = by2.MIN_VALUE;

            if(by1 == by2)
            {
                System.out.println("Operation '=' compares the reference of Byte objects and equal");
            }else System.out.println("Operation '=' compares the objects of Byte objects and not equal");

            if(by1.equals(by2))
            {
                System.out.println("Function 'equals()' compares the value of Byte objects and equal");
            }else System.out.println("Function 'equals()' compares the value of Byte objects and not equal");

            Byte by3 = by1;
            if(by3 == by1)
            {
                System.out.println("Operation '=' compares the reference of Byte objects and equal");
            }else System.out.println("Operation '=' compares the reference of Byte objects and not equal");

            System.out.println(by1);
            System.out.println(by2);
            System.out.println("The length is "+length);
            System.out.println("MAX:"+max+" MIN"+min);
            byte temp = (byte)241; // 241的二进制表示为11110001（补码），其中第一位为符号位，那么剩余的计算结果为15，最终结果为-15
            System.out.println(temp);
        }


}
